import type { RentApplyParams, RentListItem, RentListPageParams } from "./../types/rent.d";
import { FilterItem, PageResult } from "../types/global";
import http from "../utils/http";

// 器材租售分类
export const postRentSaleCategory = () => {
  return http<FilterItem[]>({
    url: "RentSaleCategory/all",
    method: "POST",
  });
};

// 航空公司
export const postRentSaleCompany = () => {
  return http<FilterItem[]>({
    url: "RentSaleCompany/all",
    method: "POST",
  });
};

// 航空条件
export const postRentSaleCond = () => {
  return http<FilterItem[]>({
    url: "RentSaleCond/all",
    method: "POST",
  });
};

// 航空类型
export const postRentSaleType = () => {
  return http<FilterItem[]>({
    url: "RentSaleType/all",
    method: "POST",
  });
};

// 发动机类型
export const postRentSaleEngineType = () => {
  return http<FilterItem[]>({
    url: "RentSaleEngineType/all",
    method: "POST",
  });
};

// 租售列表
export const postRentSaleListData = (data: RentListPageParams) => {
  return http<PageResult<RentListItem[]>>({
    url: "RentSale/index",
    method: "POST",
    data,
  });
};

// 租赁咨询
export const postRentApply = (data: RentApplyParams) => {
  return http<any>({
    url: "RentSaleSubmit/create",
    method: "POST",
    data,
  });
};

